<?php
/*
  $Id: stats_referral_sources.php,v 1.0 2004/06/07 22:50:52 rmh Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2004 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script type="text/javascript" src="includes/menu.js"></script>
<script type="text/javascript" src="includes/general.js"></script>
</head>
<body bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
        </table></td>
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0" >
			  <tr>
				<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
				<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
			  </tr>
			</table><p>
			<?php
			// OBS!!! don't forget to put your gift cards model numbers in the 'do not include' list at the end of this sql...
			$inventory_query_raw = "select products_model, products_quantity, products_cost, products_price from " . TABLE_PRODUCTS . " WHERE products_model != 'GIFT50' and products_model != 'GIFT150' and products_model != 'GIFT100' and products_model != 'dr-pr-050' and products_model != 'dr-pr-150' and products_model != 'dr-pr-100'" ;
			$inventory_query = tep_db_query($inventory_query_raw);
			while ($inventory = tep_db_fetch_array($inventory_query)) {
				$inventory_cost = $inventory_cost + ($inventory["products_quantity"] * $inventory["products_cost"]);
				$inventory_price = $inventory_price + ($inventory["products_quantity"] * $inventory["products_price"]);
			}
			?><p>
          <p><?php echo INVENTORY_COST." = ".$currencies->format($inventory_cost); ?></p>
		  <p><?php echo INVENTORY_VALUE." = ".$currencies->format($inventory_price); ?></p>
		</td>
      </tr>
    </table>
	</td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
